home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / timevent / taskmstr / listconn.tsk < prev    next >
Encoding:
Text File  |  1995-05-07  |  1.7 KB  |  86 lines

  1. /////////////////////////////////////////////////////////////////////////
  2. // Examples of how to utilize the following System Environment variables:
  3. //
  4. //   CONN_NAME               CONN_ID
  5. //   CONN_ADDRESS            CONNS_IN_USE
  6. //   CONNS_MAX               CONNS_PEAK
  7. //   SERVER
  8. //
  9. // This task file will display a listing of all users logged in
  10. /////////////////////////////////////////////////////////////////////////
  11.  
  12.  
  13. // Define variable %0 as the first connection
  14.  
  15. DEFINE %0 0001
  16.  
  17.  
  18. // Define variable %1 for prompting to continue (24=prompt)
  19.  
  20. DEFINE %1 0000
  21.  
  22.  
  23. // Define variable %2 for header display (0=display header)
  24.  
  25. DEFINE %2 0000
  26.  
  27.  
  28.  
  29. // Display information on all active connections
  30.  
  31. WHILE %0<=%CONNS_PEAK%
  32.  
  33.  
  34.   // should we prompt to continue
  35.  
  36.   IF %1==0024
  37.     PAUSE
  38.  
  39.     // reset the display counter
  40.  
  41.     DEFINE %1 0005
  42.  
  43.     // set the header variable
  44.  
  45.     DEFINE %2 0000
  46.  
  47.   ENDIF
  48.  
  49.  
  50.   // display the header information
  51.  
  52.   IF %2==0000
  53.     CLS
  54.     ECHO User Listing for %SERVER%
  55.     ECHO %CONNS_IN_USE% of %CONNS_MAX% connections in use.
  56.     ECHO.
  57.     ECHO Conn  Net/Node Address       User Name (Object ID)
  58.     ECHO ----  ---------------------  -----------------------------------------
  59.  
  60.  
  61.     // reset header variables
  62.  
  63.     DEFINE %2 0001
  64.  
  65.   ENDIF
  66.  
  67.  
  68.   // make sure the connection is in use
  69.  
  70.   IF NOT "%CONN_NAME_%0%"=="INACTIVE" AND NOT "%CONN_NAME_%0%"=="NOT-LOGGED-IN"
  71.  
  72.     // display the connection information
  73.  
  74.     ECHO %0  %CONN_ADDRESS_%0%  %CONN_NAME_%0% (%CONN_ID_%0%)
  75.  
  76.   ENDIF
  77.  
  78.  
  79.   // increment the counters
  80.  
  81.   DEFINE %0 %0+=1
  82.   DEFINE %1 %1+=1
  83.  
  84. LOOP
  85.  
  86.